package com.punch.order.constants;

/**
 * 订单类型,方便以后扩展
 */
public enum OrderTypeEnum {


    THREE_HALF(1, "三点半");


    private int code;
    private String name;

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    OrderTypeEnum(int code, String name) {
        this.code = code;
        this.name = name;
    }

    public static String getName(Integer code) {
        if (code == null) {
            return "";
        }
        for (OrderTypeEnum orderType : OrderTypeEnum.values()) {
            if (orderType.getCode() == code) {
                return orderType.getName();
            }
        }
        return "";
    }
}
